//
//  NKTabBarController.m
//  NKMapTest
//
//  Created by SongGang on 2017/4/17.
//  Copyright © 2017年 NK. All rights reserved.
//

#import "NKTabBarController.h"
#import "NKNavigationViewController.h"
#import "NKRecommendViewController.h"
#import "NKMapViewController.h"
#import "NKMessageViewController.h"
#import "NKMeViewController.h"

@interface NKTabBarController ()

@end

@implementation NKTabBarController

- (void)viewDidLoad {
    [super viewDidLoad];

    [self initTabBar];
}

- (void)initTabBar {

    [self addChildViewController:[[NKRecommendViewController alloc] init] itemWithImage:nil itemWithSelectImage:nil itemWithTitle:@"推荐"];
     [self addChildViewController:[[NKMapViewController alloc] init] itemWithImage:nil itemWithSelectImage:nil itemWithTitle:@"地图"];
     [self addChildViewController:[[NKMessageViewController alloc] init] itemWithImage:nil itemWithSelectImage:nil itemWithTitle:@"消息"];
     [self addChildViewController:[[NKMeViewController alloc] init] itemWithImage:nil itemWithSelectImage:nil itemWithTitle:@"我的"];

}

- (void)addChildViewController:(UIViewController *)childController itemWithImage:(UIImage *)image itemWithSelectImage:(UIImage *)selectImage itemWithTitle:(NSString *)title {

     NKNavigationViewController *navigationVC = [[NKNavigationViewController alloc] initWithRootViewController:childController];
    navigationVC.tabBarItem.image = image;
    navigationVC.tabBarItem.selectedImage = selectImage;
    navigationVC.tabBarItem.title = title;
    [self addChildViewController:navigationVC];
    
}

@end
